﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ManageRole.ascx.vb" Inherits="WebForm_ManageDownload_ManageRole" %>

<%@ Register src="SearchRoleControl.ascx" tagname="SearchRoleControl" tagprefix="uc1" %>

<asp:FormView ID="FormView1" runat="server" DataKeyNames="FileSaveName">
    <ItemTemplate>

        <asp:Label ID="lblFileName0" runat="server" Text="<%$ Resources:FileName %>"></asp:Label>
        <asp:Label ID="lblFileName" runat="server" Text='<%# Eval("FileName") %>'></asp:Label>
        &nbsp; &nbsp;
        <asp:Label ID="lblCreateAt0" runat="server" Text="<%$ Resources:CreateAt %>"></asp:Label>
        <asp:Label ID="lblCreateAt" runat="server" Text='<%# Eval("CreateAt") %>'></asp:Label>
        <br />
        <asp:Label ID="lblFileDesc0" runat="server" Text="<%$ Resources:FileDesc %>"></asp:Label>
        <asp:Label ID="lblFileDesc" runat="server" Text='<%# Eval("FileDesc") %>'></asp:Label>
    </ItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
    OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_SelectFileInfo" 
    TypeName="BLL_ManageDownload_RoleFileMapping">
    <SelectParameters>
        <asp:Parameter DbType="Guid" Name="SelectedFileSaveName" />
    </SelectParameters>
</asp:ObjectDataSource>
<div align="right">
    <uc1:SearchRoleControl ID="SearchRoleControl1" runat="server" />
<asp:Button ID="btnAddRole" runat="server" Text="<%$ Resources:AddRole %>" />
<asp:Button ID="btnSave" runat="server" Text="<%$ Resources:Save %>" />
</div>
<My:MyGridView ID="GridView1" runat="server" AllowHoverEffect="False" 
    AllowHoverSelect="False" AutoGenerateColumns="False" EmptyDataText="<%$ Resources:NoFiles %>"
    MySortDirection="Ascending" SkinID="pager" TotalRowCount="0" 
    AllowPaging="True" AllowSorting="True" MouseOverColor="" 
    DataKeyNames="RoleID,FileSaveName">
    <Columns>
        <asp:BoundField DataField="RoleName" HeaderText="<%$ Resources:RoleName %>"
            SortExpression="RoleName" />
        <asp:TemplateField SortExpression="CanRead" HeaderText="<%$ Resources:CanRead %>">
            <ItemTemplate>
                <asp:DropDownList ID="ddlCanRead" runat="server" 
                    SelectedValue='<%# Bind("CanRead") %>'>
                    <asp:ListItem Value="False">否</asp:ListItem>
                    <asp:ListItem Value="True">是</asp:ListItem>
                </asp:DropDownList>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" Width="100px" />
        </asp:TemplateField>
        <asp:TemplateField SortExpression="CanDelete" HeaderText="<%$ Resources:CanDelete %>">
            <ItemTemplate>
                <asp:DropDownList ID="ddlCanDelete" runat="server" 
                    SelectedValue='<%# Bind("CanDelete") %>'>
                    <asp:ListItem Value="False">否</asp:ListItem>
                    <asp:ListItem Value="True">是</asp:ListItem>
                </asp:DropDownList>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" Width="100px" />
        </asp:TemplateField>
        <asp:CommandField />
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" 
                    CommandName="Delete" onclientclick="<%$ Resources:DeleteConfirm %>" 
                    Text="<%$ Resources:Delete %>"></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" Width="50px" />
        </asp:TemplateField>
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
    OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" 
    TypeName="BLL_ManageDownload_RoleFileMapping" DeleteMethod="BLL_Delete">
    <DeleteParameters>
        <asp:Parameter Name="original_RoleID" Type="Int32" />
        <asp:Parameter DbType="Guid" Name="original_FileSaveName" />
    </DeleteParameters>
    <SelectParameters>
        <asp:Parameter DbType="Guid" Name="SelectedFileSaveName" />
    </SelectParameters>
</asp:ObjectDataSource>
